<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style type="text/css">
			div {
				width: 200px;
				height: 200px;
				background-color: red;
			}
		</style>
	</head>
	<body>
		<script type="text/javascript">
			window.addEventListener("load", function() {
				var div = window.document.querySelector("div")
				window.addEventListener("resize", function() {
					console.log("窗口大小变化了");
					if (window.innerWidth < 800) {
						div.style.display = "none";
					} else {
						div.style.display = "block";
					}
				})
			})
		</script>
		<div id="">

		</div>
	</body>
</html>
